﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CoolCode.Web.Mvc;

namespace TopTen.Models
{
    [PropertiesMustMatch("Password", "ConfirmPassword", ErrorMessage = "两次输入的密码不一致")]
    public class RegisterModel
    {
        [XRequired]
        [DisplayName("用户名")]
        public string UserName { get; set; }

        [XRequired]
        [DataType(DataType.EmailAddress)]
        [DisplayName("Email")]
        public string Email { get; set; }

        [XRequired]
        [ValidatePasswordLength]
        [DataType(DataType.Password)]
        [DisplayName("密码")]
        public string Password { get; set; }

        [XRequired]
        [DataType(DataType.Password)]
        [DisplayName("密码确认")]
        public string ConfirmPassword { get; set; }
    }
}
